<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>itf_integrate_romberg</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="LIBIT Documentation"
HREF="index.html"><LINK
REL="UP"
HREF="refmanual.html"><LINK
REL="PREVIOUS"
TITLE="itf_integrate"
HREF="man.itf-integrate.html"><LINK
REL="NEXT"
TITLE="itf_integrate_trapezoid"
HREF="man.itf-integrate-trapezoid.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>LIBIT Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="man.itf-integrate.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="man.itf-integrate-trapezoid.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="MAN.ITF-INTEGRATE-ROMBERG"
></A
>itf_integrate_romberg</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN9700"
></A
><H2
>Name</H2
>itf_integrate_romberg&nbsp;--&nbsp;integration operator (Romberg)</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN9703"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><P
></P
><A
NAME="AEN9704"
></A
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include &lt;it/math.h&gt;
      </PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>double itf_integrate_romberg</CODE
>( double x, it_function_args(itf_integrate_romberg) *args
        );</CODE
></P
><P
></P
></DIV
></DIV
><H2
>DESCRIPTION</H2
><P
>The function <CODE
CLASS="FUNCTION"
>itf_integrate_romberg</CODE
> defines the integral of an it_function_t. The argument <CODE
CLASS="PARAMETER"
>x</CODE
> corresponds to the upper bound of the integral.  The integral of the function is approximated by computing the value of the function at various positions between <CODE
CLASS="PARAMETER"
>a</CODE
> and <CODE
CLASS="PARAMETER"
>x</CODE
> and using the Romberg method to compute a fast and accurate approximation. The integration operator has the following parameters, passed through the <CODE
CLASS="PARAMETER"
>args</CODE
> argument. The precision of this method is given by O(((x-a)/N)^(2p+2)) where the coefficient depends on the (2p+2)-th derivative of the function to integrate.</P
><DIV
CLASS="REFSECT2"
><A
NAME="AEN9718"
></A
><H3
>Function parameters</H3
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>a</DT
><DD
><P
>         The lower bound of the integral.
      </P
></DD
><DT
>function</DT
><DD
><P
>         The function to integrate.
      </P
></DD
><DT
>args</DT
><DD
><P
>         The parameters of the function to integrate.
      </P
></DD
><DT
>N</DT
><DD
><P
>        Number of intervals.
      </P
></DD
><DT
>p</DT
><DD
><P
>        Precision order.
      </P
></DD
></DL
></DIV
></DIV
><H2
>RETURN VALUE</H2
><P
>    The integral
   </P
><H2
>EXAMPLE</H2
><PRE
CLASS="PROGRAMLISTING"
>&#13;#include &lt;math.h&gt;

...

/* declare the integration parameters */
it_function_args(itf_integrate_romberg) integrate_args;
/* integrate the identity function, starting from 0.0 */
/* using 20 intervals and a precision order of 10     */
integrate_args.function = itf_identity;
integrate_args.args = NULL;
integrate_args.a = 0.0;
integrate_args.N = 20;
integrate_args.p = 10;
/* compute the value of the integral of x between [0,1] */
itf_integrate_romberg(1.0, &#38;integrate_args);</PRE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="man.itf-integrate.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="man.itf-integrate-trapezoid.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>itf_integrate</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="refmanual.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>itf_integrate_trapezoid</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>